package com.admin.dbdao;

import com.admin.bean.ShieldWord;
import com.data.dbdao.BaseDao;
import org.springframework.stereotype.Repository;

import javax.transaction.Transactional;
import java.util.List;

/**
 * 屏蔽词
 *
 * @author:HingLo
 * @create 2017-09-12 10:53
 **/
@Repository
@Transactional
public class ShieldWordDao extends BaseDao {

    /**
     * 查询屏蔽词
     *
     * @return
     */
    public Object findShieldWordDao() {
        String Hql = "from ShieldWord";
        List list = super.findMassageDao(Hql);
        return list.size() > 0 ? list.get(0) : null;
    }

    /**
     * 保存或更新
     *
     * @param shieldWord
     * @return
     */
    public boolean changeShieldWordDao(ShieldWord shieldWord) {
        return super.saveMassageDao(shieldWord);
    }
}
